const db = require('../../../libs/db.config');

module.exports = async (data) => {
    // const searchSQL = `SELECT * FROM user WHERE userName = "${username}"`;
    const searchSQL = 'select commodity.images, commodity.title, orders.pay, orders.pID, orders.orderID, orders.number, userinfo.userName as sellerName,userinfo.photo, orders.state from orders join commodity on commodity.pID = orders.pID join userinfo on orders.seller = userinfo.userID where orders.buyer = ?';
    return await db.query(searchSQL, [data.userID]);
};
